<?php

namespace app\controllers;
use Yii;
use app\models\BbsQuestion;
use yii\web\Controller;

class RegController extends Controller
{
   public function actionIndex()
   {

   		$data = BbsQuestion::findOne(6);


   		BbsQuestion::deleteAll(['status'=>'1']);


   		// BbsQuestion::updateAll(['title'=>'age','content'=>'bbb'],['question_id'=>6]);



   		// var_dump($data);

   		// $posts = Yii::$app->db->createCommand('select * from bbs_user')
     //        ->queryAll();

     //     var_dump($posts);exit;


      //    $rows = (new \yii\db\Query())
		    // ->select('*')
		    // ->from('bbs_user')
		    // ->where(['user_id' => '6'])
		    // ->limit(1)
		    // ->all();

		 // var_dump($rows);exit;

   		$data = [
   			'name'=>'学并思',
   			'age'=>'学并思',
   			'user'=>'学并思',
   			'top'=>'学并思',
   		];

   		return $this->render('index',$data);
   }

   public function actionCheck()
   {
   		var_dump('reg-check');
   }
}
